//引入http模组
let http = require('http');

//创建服务器
let server = http.createServer((req,res)=>{
    // 请求信息
    //屏蔽favicon.ico
    if (req.url=='/favicon.ico') {
        return;
    }
    console.log(req.url);
    res.setHeader('Content-Type','text/html;charset=utf-8');
    if (req.url =='/' || req.url=='/index') {
        res.end('首页')
    }else if (req.url=='/login') {
        res.end('登陆页面')
    }else if (req.url=='/reg') {
        res.end('注册页面')
    }else if (req.url=='/products') {
        res.end('产品列表')
    }else if (req.url=='/order') {
        res.end('订单列表')
    }else{
        res.end('404')
    } 
}).listen(7070,"www.myphp8899.com",()=>{
    console.log('服务器已启动')
 });
//绑定监听端口
